﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace AutoWizard.Meta
{
    public class EntityMeta : INotifyPropertyChanged
    {
        #region ~

        public EntityMeta()
        {
        }

        public EntityMeta(string tableName)
        {
            m_tableName = tableName;
        }
        
        #endregion

        #region TableName

        string m_tableName;

        public string TableName
        {
            get { return m_tableName; }
            set { m_tableName = value; OnPropertyChanged("TableName"); }
        }

        #endregion

        #region KeyField

        string m_KeyField;

        public string KeyField
        {
            get { return m_KeyField; }
            set { m_KeyField = value; OnPropertyChanged("KeyField"); }
        }

        #endregion

        #region Propertys

        List<PropertyMeta> m_Propertys = new List<PropertyMeta>();

        public List<PropertyMeta> Propertys
        {
            get
            {
                return m_Propertys;
            }
        }

        #endregion

        #region GenConfig

        GenerateConfig m_GenConfig = new GenerateConfig();

        public GenerateConfig GenConfig
        {
            get { return m_GenConfig; }
            set { m_GenConfig = value; }
        }

        #endregion

        #region INotifyPropertyChanged 成员

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {

            OnPropertyChanged(new PropertyChangedEventArgs(propertyName));

        }



        protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
        {

            if (null != PropertyChanged)
            {

                PropertyChanged(this, e);

            }

        }


        #endregion

    }
}
